package common.db.id;



/**
 * User: Alexey Kostylev
 * Date: 20.03.2009
 * Time: 11:04:07
 */
public abstract class EnumIdObject implements Identified
{
	private Enum id;

	public EnumIdObject(Enum id)
	{
		this.id = id;
	}

	public Enum getId()
	{
		return id;
	}

	@Override
	public boolean equals(Object o)
	{
		if (this == o)
		{
			return true;
		}
		if ((o == null) || (getClass() != o.getClass()))
		{
			return false;
		}

		EnumIdObject that = (EnumIdObject)o;

		if (id != that.id)
		{
			return false;
		}

		return true;
	}

	@Override
	public int hashCode()
	{
		int result = 17;
		result = 37 * result + (id == null ? 0 : id.hashCode());
		return result;
	}

}
